import React from "react";
import PropTypes from 'prop-types';

export default function Student(props) {
    //解构赋值
    let { name, age, gender } = props;
    return (
        <ul>
            <li>姓名: {name}</li>
            <li>年龄: {age}</li>
            <li>性别: {gender}</li>
        </ul>
    );
}

// 限制属性值的类型  static propTypes = 
Student.propTypes = {
    name: PropTypes.string
}

//设置属性值的默认值
Student.defaultProps = {
    name: '张三'
}